﻿<!DOCTYPE html>
<!--申请修改审批-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

    <style>
        .el-dialog__body {
            height: 100% !important;
        }

        .el-dialog.is-fullscreen {
            overflow: hidden !important;
        }

        body {
            padding-bottom: 10px;
        }

        .main-label {
            width: 100%;
            text-align: left;
            float: left;
            font-size: 14px;
            color: #606266;
            line-height: 40px;
            box-sizing: border-box;
            margin: 0;
        }

        .dian {
            display: inline-block;
            width: 5px;
            height: 5px;
            margin-left: 50px;
            background: #000;
            border-radius: 50%;
        }

        table {
            width: 100%;
            border-top: 0px solid;
            border-left: 0px solid;
        }

        table td,
        table th {
            border-right: 0px solid;
            border-bottom: 0px solid;
            border: 1px solid #dcdcdc;
            padding: 10px;
        }

        .el-form-item__label {
            text-align: left !important;
            padding-right: 20px !important;
            width: 132px !important;
        }
    </style>
    <style>
        /*说明：
             由于mystyle.css中162行.el-form-item__content {line-height: normal!important;}导致的
             index.css中.el-form-item--mini .el-form-item__content, .el-form-item--mini .el-form-item__label{    line-height: 28px;}失效
             但出于无法修改样式表的情况，所以在该页面添加以下样式，以保证页面内标题和内容不偏离
            */
        .el-form-item--mini .el-form-item__content,
        .el-form-item--mini .el-form-item__label {
            line-height: 28px !important;
        }

        table {
            width: 100%;
            border-color: #696969;
        }

        td {
            width: 50%;
        }
    </style>
    <style>
        .el-dialog__body {
            height: 100% !important;
        }

        .el-dialog.is-fullscreen {
            overflow: hidden !important;
        }

        body {
            padding-bottom: 10px;
        }

        /*说明：
             由于mystyle.css中162行.el-form-item__content {line-height: normal!important;}导致的
             index.css中.el-form-item--mini .el-form-item__content, .el-form-item--mini .el-form-item__label{    line-height: 28px;}失效
             但出于无法修改样式表的情况，所以在该页面添加以下样式，以保证页面内标题和内容不偏离
            */
        .el-form-item--mini .el-form-item__content,
        .el-form-item--mini .el-form-item__label {
            line-height: 28px !important;
        }

        ._delete-icon {
            position: absolute;
            right: 5px;
            bottom: 13px;
            cursor: pointer;
            display: none;
            width: 10px;
            height: 10px;
            display: block;
        }
    </style>
</head>

<body>
    <div id="app" v-cloak class="popupW100">
        <el-form :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px" size="mini"
            label-position="right">
            <el-row>
                <el-col class="head-tool">
                    <strong>隐患基础信息</strong>
                    <el-button class="fr" type="primary">{{col.btnPrint}}</el-button>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="15">
                    <el-form-item :label="RisksManagement.ApplyModifyApproval.RiskDescription+mark.m"
                        class="inputTextarea">
                        {{Form.RiskDescription}}
                    </el-form-item>
                </el-col>
                <el-col :span="7" offset="2">
                    <el-link :underline="false" @click="OpenRiskDetails" type="primary"
                        style="font-size: 14px;color:#409eff;cursor:pointer;">
                        {{RisksManagement.ApplyModifyApproval.RiskDetails}}</el-link>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-col>
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-form-item :label="RisksManagement.ApplyModifyApproval.RectificationCase+mark.m"
                                    class="inputTextarea">
                                    {{Form.RectificationCase}}

                                </el-form-item>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-col>
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-form-item :label="RisksManagement.ApplyModifyApproval.RectificationFund+mark.m"
                                    class="inputTextarea">
                                    {{Form.RectificationFund}}

                                </el-form-item>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="11">
                    <el-col>
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-form-item :label="RisksManagement.ExternalInspection.RectificationLeading+mark.m"
                                    class="inputTextarea">
                                    {{Form.RectificationLeading}}
                                </el-form-item>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-col>
                <el-col :span="11">
                    <el-col>
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-form-item :label="RisksManagement.ApplyModifyApproval.Department+mark.m"
                                    class="inputTextarea">
                                    {{Form.Department}}
                                </el-form-item>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-col>
                <el-col :span="11">
                    <el-col>
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-form-item :label="RisksManagement.ApplyModifyApproval.Rectification+mark.m"
                                    class="inputTextarea">
                                    {{Form.Rectification}}
                                </el-form-item>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-col>
                <el-col :span="11">
                    <el-col>
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-form-item :label="RisksManagement.ApplyModifyApproval.PlanTime+mark.m"
                                    class="inputTextarea">
                                    {{Form.PlanTime}}
                                </el-form-item>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-col>
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-form-item :label="RisksManagement.ApplyModifyApproval.HaveContingencyPlan+mark.m"
                                    class="inputTextarea">
                                    {{Form.HaveContingencyPlan}}
                                </el-form-item>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-form-item :label="RisksManagement.ApplyModifyApproval.CurrentPlan+mark.m" class="inputTextarea">
                        {{Form.CurrentPlan}}
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <el-form-item>
                        <div class="elst-select-mini" style="margin-left: -100px">
                            <el-input size="mini">
                                <template slot="prepend">
                                    {{RisksManagement.ApplyModifyApproval.ActualTime+mark.m}}
                                </template>
                                <el-date-picker slot="suffix" v-model="Form.ActualTime" type="datetime" size="mini"
                                    format="yyyy-MM-dd HH:mm:ss" placeholder="选择时间">
                                </el-date-picker>
                            </el-input>
                        </div>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="24">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <div class="el-input--mini el-input-group">
                                <div class="el-input-group__prepend">
                                    {{RisksManagement.ApplyModifyApproval.RectificationDescription+mark.m}}
                                </div>
                                <el-input class="el-textarea__inner" type="textarea"
                                    v-model="Form.RectificationDescription" autocomplete="off"></el-input>
                            </div>
                        </el-form-item>
                    </div>
                </el-col>

            </el-row>


            <el-row>
                <el-col :span="24">

                    <el-form-item :label="RisksManagement.ApplyModifyApproval.AfterRImg+mark.m" prop="AfterRImg"
                        class="inputTextarea" style="position:relative;">

                        <el-upload class="upload-demo" :show-file-list="false" accept=".jpg,.jpeg,.png,.gif" action=""
                            :limit="1" :on-change="UploadChange" style="position:absolute;top:26px;left:-95px;">
                            <el-button type="primary">{{col.btnUpLoad}}</el-button>
                        </el-upload>

                        <div v-for="src in Form.AfterRImg" style="float:left;margin-right:5px;position:relative;"
                            class="ImgBox">
                            <i class="el-icon-delete _delete-icon" @click="deleteImg(src.id)"></i>
                            <el-image :src="src.Img" fit="fill" width="200" height="100">
                            </el-image>
                        </div>
                    </el-form-item>
                </el-col>
                <el-col :span="8">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input type="text" v-model="Form.Acceptancer" autocomplete="off" size="mini"
                                :disabled="true">
                                <template slot="prepend">
                                    {{RisksManagement.ApplyModifyApproval.Acceptancer+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="3" offset="1">
                    <el-button type="primary" @click="addPerson" class="fl ml10">
                        选择验收人
                    </el-button>
                </el-col>
            </el-row>



            <el-row>
                <el-col class="head-tool">
                    <strong>隐患流转记录</strong>
                </el-col>
            </el-row>
            <el-row>
                <table cellpadding="0" cellspacing="0" style="border-collapse:collapse;">
                    <tr>
                        <td>
                            <p class="main-label">{{RisksManagement.ApplyModifyApproval.ReportTime+mark.m}}<span
                                    class="dian"></span> </p>
                            <p class="lh35">{{Form.ReportTime}}</p>
                        </td>
                        <td>
                            <el-col :span="24">
                                <el-form-item :label="RisksManagement.ApplyModifyApproval.ReportDepartment+mark.m">
                                    {{Form.ReportDepartment}}
                                </el-form-item>
                            </el-col>
                            <el-col :span="24">
                                <el-form-item :label="RisksManagement.ApplyModifyApproval.ReportPersonnel+mark.m">
                                    {{Form.ReportPersonnel}}
                                </el-form-item>
                            </el-col>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="main-label">{{RisksManagement.ApplyModifyApproval.DevelopPlanTime+mark.m}}<span
                                    class="dian"></span> </p>
                            <p class="lh35">{{Form.DevelopPlanTime}}</p>
                        </td>
                        <td>
                            <el-col :span="24">
                                <el-form-item :label="RisksManagement.ApplyModifyApproval.Department+mark.m">
                                    {{Form.Department}}
                                </el-form-item>
                            </el-col>
                            <el-col :span="24">
                                <el-form-item :label="RisksManagement.ApplyModifyApproval.RectificationLeading+mark.m">
                                    {{Form.RectificationLeading}}
                                </el-form-item>
                            </el-col>
                            <el-col :span="24">
                                <el-form-item :label="RisksManagement.ApplyModifyApproval.PlanTime+mark.m">
                                    {{Form.PlanTime}}
                                </el-form-item>
                            </el-col>
                        </td>
                    </tr>
                </table>
            </el-row>

            <br>

            <el-row type="flex" justify="end">
                <el-form-item>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSave}}</el-button>
                    <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnCommit}}</el-button>
                    <el-button type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}</el-button>
                </el-form-item>
            </el-row>
        </el-form>
        <el-dialog title="隐患记录详细信息" :visible.sync="ListItem.dialogVisible" width="80%" height="80%" top="10vh"
            fullscreen="true">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        app = new Vue({
            el: '#app',
            data: {
                //父业传参
                id: '',
                ListItem: ListItem,
                //业务表单内容
                Form: {
                    id: guidEmpty,
                    ActualTime: '',
                    RectificationDescription: '',
                    Rectification: '',
                    AfterRImg: [],
                },
                SetRectificationLeading: [],
                //表单验证
                rules: {

                }
            },

            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                //上传状态改变事件，随便选个可触发的钩子模拟上传
                UploadChange: function (file, filelist) {
                    if (file.status == 'ready') {

                        this.Form.AfterRImg.push({
                            id: Mock.Random.id(),
                            Img: Mock.Random.image('200x100', '#1989fa', '#FFFFFF', 'Test Image' + ($(".ImgBox").length + 1)),
                        });
                    }
                    else if (file.status == 'fail') {

                    }
                },
                //图片临时删除
                deleteImg: function (id) {
                    var list = this.Form.AfterRImg;
                    this.$confirm(' 是否确认继续?', '提示', {
                        confirmButtonText: '确定',
                        cancelButtonText: '取消',
                        type: 'warning'
                    }).then(function () {
                        list.forEach(function (v, i) {
                            if (v.id + '' === id + '') {
                                list.splice(i, 1);
                            }
                        })
                    }).catch(function () {
                        showMessage("已取消删除!");
                    });
                },
                addPerson: function (val, id) {
                    this.title = '选择验收人';
                    DialogShow(this, val, "RiskRectificationInputAddPerson.html", id);
                },
                //隐患记录详细信息
                OpenRiskDetails: function () {
                    DialogShow(this, 'xg', "../RiskRecordView.html", this.id);
                },
                //提交数据
                onSubmitForm: function (formName) {
                    //如果应急预案选择否，则应急预案内容清空
                    if (this.Form.HaveContingencyPlan == '0') {
                        this.Form.EmergencyPlan = '';
                    }
                    var mythis = this;
                    this.$refs[formName].validate(function (valid) {
                        //验证通过
                        if (valid) {
                            onSubmitForm(this, '/api/ApplyModifyApproval/Save', mythis.Form);
                        } else {
                            //验证失败
                            return false;
                        }
                    });

                },
                getData: function () {
                    getData(this, '/api/ApplyModifyApproval/get?id=' + this.id);
                },
            },
            mounted: function () {
                this.id = getUrlParam("id");
                this.getData();
            }
        });
    </script>
</body>

</html>